package com.glsc.ngateway.platform.repo;

import com.glsc.ngateway.platform.domain.RequirementTeskCase;
import com.glsc.ngateway.platform.domain.TestTask;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface RequirementTeskCaseRepo extends JpaRepository<RequirementTeskCase, Long>, JpaSpecificationExecutor<RequirementTeskCase> {
//    @Query(value = "select m from RequirementTeskCase m where m.processId = :processId")
//    List<RequirementTeskCase> queryByProcessId(@Param("processId") String  processId);

    @Query(value = "select m.testTaskId from RequirementTeskCase m where m.operator = :operator")
    List<Long> queryTestTaskIdByOperator(@Param("operator") String  operator);

    List<RequirementTeskCase> findAllByOperator(String account);

    List<RequirementTeskCase> queryByProcessIdAndTestTaskIdIsNotNull(String processId);
}
